<?php

include('../model/db.php');

$gameid = $_POST['gameid'];
freeQuery("UPDATE games SET games.timeleft = SUBTIME( games.timeleft,  '00:00:05' )
WHERE id =$gameid");

$timeleftarray = select_from_db(array('timeleft'),array('games'),array("id=$gameid"));
if(($timeleftarray[0]['timeleft']) == '00:00:00'){
	echo 'slut';
}else{
	echo $timeleftarray[0]['timeleft'];
}


?>